package de.hsmannheim.poolraumapp.model;

public class RoomReservation {
	private int block;
	private int day;
	private String building;
	private String roomNumber;
	private String department;
	
	public RoomReservation(int block, int day, String building, String roomNumber, String department) {
		this.block = block;
		this.day = day;
		this.building = building;
		this.roomNumber = roomNumber;
		this.department = department;
	}
	
	public int getBlock() {
		return block;
	}
	public int getDay() {
		return day;
	}
	public String getBuilding() {
		return building;
	}
	public String getRoomNumber() {
		return roomNumber;
	}
	public String getDepartment() {
		return department;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + block;
		result = prime * result
				+ ((building == null) ? 0 : building.hashCode());
		result = prime * result + day;
		result = prime * result
				+ ((department == null) ? 0 : department.hashCode());
		result = prime * result
				+ ((roomNumber == null) ? 0 : roomNumber.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RoomReservation other = (RoomReservation) obj;
		if (block != other.block)
			return false;
		if (building == null) {
			if (other.building != null)
				return false;
		} else if (!building.equals(other.building))
			return false;
		if (day != other.day)
			return false;
		if (department == null) {
			if (other.department != null)
				return false;
		} else if (!department.equals(other.department))
			return false;
		if (roomNumber == null) {
			if (other.roomNumber != null)
				return false;
		} else if (!roomNumber.equals(other.roomNumber))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "RoomReservation [block=" + block + ", day=" + day
				+ ", building=" + building + ", roomNumber=" + roomNumber
				+ ", department=" + department + "]";
	}	
}
